package com.how2j.springcloud.controller;

import com.how2j.springcloud.pojo.Product;
import com.how2j.springcloud.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author: kaiyi
 * @create: 2020-10-23 22:58
 */
@RestController
public class ProductController {
  @Autowired
  ProductService productService;

  @RequestMapping("/products")
  public List<Product> products(){
    List<Product> products = productService.listProducts();
    return products;
  }

}
